/*
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU Lesser General Public License Version
 *  3 as published by the Free Software Foundation.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public
 *  License along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307,
 *  USA.
 */

#ifndef CONNECTOR_H
#define CONNECTOR_H

#include <QObject>
#include <QtNetwork>

class Connector : public QObject
{
Q_OBJECT
public:
    Connector(QObject *parent = 0);
    ~Connector();
    bool connectOptra(const QString& host, qint16 port);
    bool send(const QString& command);
signals:
    void result(const QString& res);
    void ready();
    void error(const QString& error);

private slots:
    void connected();
    void disconnected();
    void displayError(QAbstractSocket::SocketError);
    void readyRead();
private:
       QTcpSocket* client;
};

#endif // CONNECTOR_H
